Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a pointer for BaseClient.productCheckMu #905

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arp242
Copy link

@arp242 arp242 commented Sep 11, 2024

I would like to convert a TypedClient to a regular Client; my main use-case for this is so I can use it for the bulk indexer.

Converting a TypedClient to Client is fairly straight-forward:

func ToClient(tc *elasticsearch.TypedClient) *elasticsearch.Client {
	c := &elasticsearch.Client{
		BaseClient: tc.BaseClient,
	}
	c.API = esapi.New(c)
	return c
}

Which works, but also gives an error on go vet;

literal copies lock value from ns.TypedClient.BaseClient:
github.com/elastic/go-elasticsearch/v8.BaseClient contains sync.RWMutex

This fixes that.

Copy link

cla-checker-service bot commented Sep 11, 2024

💚 CLA has been signed

I would like to convert a TypedClient to a regular Client; my main
use-case for this is so I can use it for the bulk indexer.

Converting a TypedClient to Client is fairly straight-forward:

	func ToClient(tc *elasticsearch.TypedClient) *elasticsearch.Client {
		c := &elasticsearch.Client{
			BaseClient: tc.BaseClient,
		}
		c.API = esapi.New(c)
		return c
	}

Which works, but also gives an error on go vet;

	literal copies lock value from ns.TypedClient.BaseClient:
	github.com/elastic/go-elasticsearch/v8.BaseClient contains sync.RWMutex

This fixes that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant